import {createStore} from 'redux';//1.引用

let initStore={  //5.初始化数据
    text:"store初始值",
    city:"city初始值",
    stoptype:"stoptype初始值"
}
let reducer=(state=initStore,action)=>{  //4.创建reducer,并传入state默认值
    switch (action.type){
        case "REV":
            return {...store,text:action.data};
        case "CITY":
            return {...store,city:action.citydata};
        case "STOPTYPE":
            return {...store,stoptype:action.stopdata};
        default:
            return state;
    }
}
let store=createStore(reducer); //2.创建store核心对象并且传入reducer
export default store;